package com.zh.streamdemo.demo1;

import java.util.stream.Stream;

public class DemoMap {

    public static void main(String[] args) {
        Stream<Integer> integerStream = Stream.of("Stream1", "Stream2", "Stream3", "Stream4", "Stream5").map(DemoMap::itemIndex);
        Stream<StringBuilder> stringBuilderStream = Stream.of("Stream1", "Stream2", "Stream3", "Stream4", "Stream5").map(item -> {
            return new StringBuilder(item);
        });
    }

    private static int itemIndex(String item) {
        return Integer.parseInt(String.valueOf(item.charAt(item.length()-1)));
    }
}
